<template>
	<view class="voterecode-history">
		<uni-section title="查看投票记录" type="line" class="playeraction-info">
			<uni-card :is-shadow="true" class="action-card" v-for="(item,index1) in voteRecordList" :key="index1">
				<uni-title type="h2" :title="item.gameStage" color="#2490ff"></uni-title>
				<view class="vote-text" v-for="(voteitem,index2) in item.voteRecord" :key="index2">
					<h4 style="font-weight: 700;">第{{index}}轮投票</h4>
					<view class="vote-text" v-for="(trunitem,index3) in voteitem" :key="index3" >
						&nbsp;{{trunitem.seatNum}}&nbsp;号玩家获得<text
							class="hightlight">{{trunitem.votedCount}}</text>票，投他的玩家为&nbsp;{{trunitem.voteplayers}}&nbsp;号
					</view>
				</view>
				<!-- 后续优化增加被投出玩家结果展示 -->
			</uni-card>
		</uni-section>
	</view>
</template>

<script>
	import {mapState,mapMutations,mapGetters,mapActions} from "@/store/helper/dm"
	export default {
		data() {
			return {
				selectedGameStage: "",
				voteRecordList: [
					// {
					// 	gameStage:"警长竞选",
					// 	voteRecord:{
					// 		"1":[{seatNum:"4",votedCount:"2",voteplayers:"1,2"},{seatNum:"5",votedCount:"2",voteplayers:"6,7"}],
					// 		"2":[{seatNum:"4",votedCount:"1",voteplayers:"1"},{seatNum:"5",votedCount:"3",voteplayers:"2,6,7"}],	
					// 		}
					// }
				],
			};
		},
		computed: {
			...mapState([
				"currentGameID",
				"gameStatus",
				"gamePlayers",
				"gameStageCode",
				"gameStageVoteStatus",
				"stageInfoMap"
			]),
			...mapGetters([
				"gameStageCodeTrans",
				"gameVoteResultList"
				
			])
		},
		onLoad() {
			this.voteRecordList=this.gameVoteResultList
		},

	};
</script>

<style scoped lang="scss">
	.playeraction-info {
		height: 700px;
	}

	.action-text {
		display: flex;
		justify-content: flex-start;
		align-items: center;
		flex-wrap: wrap;
		flex: 1
	}

	.vote-text {
		margin: 10px 0;
	}
	.hightlight{
		margin: 0 5px;
		color: $uni-color-primary;
		font-weight: 700;
		font-size: $uni-font-size-slg;
	}
</style>
